<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>打印管理</title>
<script language=JavaScript src="/fuman/js/lodop/LodopFuncs.js"></script>
<script type="text/javascript">
    //获得打印控件对象
    var LODOP;
    var weight='5cm';
    var height='2cm';
    //批量快递单预览
    function prn_print() {
        //获得订单总数
        var sku=document.getElementsByName('productsku');
        var pname=document.getElementsByName('pname');
        var printdate=document.getElementsByName('printdate');
        //迭代元素
        LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
        LODOP.PRINT_INIT("5*2商品标签");
        LODOP.SET_PRINT_PAGESIZE(0,weight,height,"CreateCustomPage");
        for(var i=0;i<sku.length;i++){
            //初始化页面
            //Setup2(sku[i].value,pname[i].value,printdate[i].value);
            //LODOP.printa();
            //LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
           // LODOP.PRINT_INIT("produtclabel52");
            //LODOP.SET_PRINT_PAGESIZE(0,weight,height,"CreateCustomPage");
            LODOP.ADD_PRINT_BARCODE("0.05cm","0.2cm","4.5cm","0.8cm","128Auto",sku[i].value);
            LODOP.ADD_PRINT_TEXT("1.0cm",0,"5cm","1.0cm"," "+pname[i].value+"\r\n"+" "+printdate[i].value);
        }
        LODOP.PRINT_DESIGN();
        LODOP.printa();
    };
    //单个快递单预览
    function prn_one_preview(rownum,pname,printdate) {
        //初始化页面
        LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
        LODOP.PRINT_INIT("5*2商品标签");
        LODOP.SET_PRINT_PAGESIZE(0,weight,height,"CreateCustomPage");
        Setup2(rownum,pname,printdate);
        LODOP.printa();
    }
    function Setup2(str,pname,printdate) {
        LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
        LODOP.PRINT_INIT("produtclabel52");
        LODOP.SET_PRINT_PAGESIZE(0,weight,height,"CreateCustomPage");
        LODOP.ADD_PRINT_BARCODE("0.05cm","0.2cm","4.5cm","0.8cm","128Auto",str);
        LODOP.ADD_PRINT_TEXT("1.0cm",0,"5cm","1.0cm"," "+pname+"\r\n"+" "+printdate);
        LODOP.PRINT_DESIGN();
    };
</script>
<body>
<!-- 主体 -->
<div class="bs_if_wrap" style="width:100%;">
    <div class="bs_mainArea" >
        请先下载 <a href="/fuman/js/lodop/CLodop_Setup_for_Win32NT.exe">CLodop_Setup_for_Win32NT.exe</a> ，并完成安装后，在打印！
        <br/><br/>
        <div style="font-size:13px;font-weight:bold;color:#3567F0"">帮助:打印5*2尺寸热敏标签,如果出现"打印控件未安装!点击这里执行安装,安装后请刷新页面或重新进入。"字样请点击"执行安装"链接安装打印控件<br/>
        安装完成后重新进入页面点击打印预览或批量打印按钮打印标签<br/>
        如出现不规则分页请确认打印机默认页面尺寸为5*2厘米<br/>
        本功能不适合普通A4喷墨打印机使用<br/>
        预览:<img src="/fuman/js/lodop/ceshi.png" style="width:188px;heigth:80px;" id="showimg">
    </div>
    <!-- 最近留言 -->
    <div >
    </div>
    <div >
        <!--pageheader-->
        <div align=center>
            <a href="javascript:prn_print()" class="btn_style09"><span>批量打印</span></a>&nbsp;&nbsp;
        </div>
    </div>
</div>
        <table cellpadding="0" cellspacing="0" border="0" class="tablelist stdtable" style="width: 100%;">
                    <thead>
                    <tr class="lbbt">
                        <td  bgcolor="#FEFFF1">商品编号</td>
                        <td  bgcolor="#FEFFF1">操作</td>
                    </tr>
                    </thead>
                    <tbody >
                    {{foreach from=$stocklist item=li key=key}}
                        <tr>
                            <td valign="middle" bgcolor="#FFFFFF">
                                {{$li.productsku}}
                                <input type="hidden" name="productsku" value="{{$li.productsku}}"/>
                                <input type="hidden" name="pname" value="{{$li.productname}}"/>
                                <input type="hidden" name="printdate" value="{{$li.updatetime}}"/>
                            </td>
                            <td bgcolor="#FFFFFF">
                                <a href="javascript:prn_one_preview('{{$li.productsku}}','{{$li.productname}}','{{$li.updatetime}}')" style="color:dodgerblue;" class="d_blue">打印</a>
                            </td>
                        </tr>
                    {{/foreach}}
                    </tbody>
                </table>
</body>
</html>